package com.loyal.loyalerp.humenresource.role.util;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.loyal.loyalerp.humenresource.role.mapper.GyRoleMapper;

@Component
public class ActiveJsonSerializer extends JsonSerializer<Byte>{

	@Autowired
	GyRoleMapper gyRoleMapper;

	@Override
	public void serialize(Byte str, JsonGenerator gen, SerializerProvider serializers)
			throws IOException, JsonProcessingException {
		if(str.equals(new Byte("0"))) {
			gen.writeString("不可用");
		}else if(str.equals(new Byte("1"))) {
			gen.writeString("可用");
		}
	}
	
	
}